const setRem = () => {
  // 获取屏幕宽度
  const width = document.documentElement.getBoundingClientRect().width;
  document.documentElement.style.fontSize = width / 10 + 'px';
}
setRem();
window.addEventListener('orientationchange', setRem);
window.addEventListener('resize', setRem);